<template>
  <div>
    <label for="" v-for="(item, index) in list" :key="index">
      <input v-model="newList" type="checkbox" :value="item" />{{ item }}
    </label>
    <br />
    <span>你选择的总和等于：{{ total }}</span>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      newList: [],
    };
  },
  computed: {
    total: {
      set() {},
      get() {
        return this.newList.reduce((result, item) => {
          return (result += item);
        }, 0);
      },
    },
  },
};
</script>

<style>
label input {
  width: 30px;
  margin: 20px;
}
</style>